;(asdf:operate 'asdf:load-op :ht-simple-ajax)

;(ql:quickload "ht-simple-ajax")

(cl:defpackage :http-server
  (:use :common-lisp :ht-simple-ajax :hunchentoot); :login :register)
  (:export :tbg-ajax-processor))

(in-package :http-server)


;;(in-package :ht-simple-ajax)

;;;;; First we create an ajax processor that will handle our function calls
(defparameter tbg-ajax-processor 
  (make-instance 'ajax-processor :server-uri "/ajax"))

;;;;; Next, we setup and start a hunchentoot web server:
(defparameter *turnbasedgame-server* 
  (start (make-instance 'acceptor :address "localhost" :port 8082)))


;;;;; We add our ajax processor to the hunchentoot dispatch table
(setq *dispatch-table* (list 'dispatch-easy-handlers 
                             (create-ajax-dispatcher tbg-ajax-processor)))

;(login:load-login-page)
;(register:load-register-page)


